/**
 * Created by tanyichao on 2017/4/20.
 */
const state = {
    //城市名字  城市id
    switchCityObj:{},
    //包含 定位城市名字  经纬度
    nearStoreObj:{},
    //门店id
    stStoreId:''
}
const mutations = {
    updateSwitchCityObj(state, payload) {
        state.switchCityObj = payload.switchCityObj;
    },
    updateNearStoreObj(state, payload) {
        state.nearStoreObj = payload.nearStoreObj;
    },
    updateStoreId(state, payload) {
        state.stStoreId = payload.stStoreId;
    },
}
const actions = {
    updateSwitchCityObj({commit}, switchCityObj) {
        commit({type: 'updateSwitchCityObj', switchCityObj: switchCityObj})
    },
    updateNearStoreObj({commit}, nearStoreObj) {
        commit({type: 'updateNearStoreObj', nearStoreObj: nearStoreObj})
    },
    updateStoreId({commit}, stStoreId) {
        commit({type: 'updateStoreId', stStoreId: stStoreId})
    },
}

export default {
    state,
    actions,
    mutations
}
